package com.cms.util;

import java.util.List;

import com.cms.entity.Article;

public class Lucenemian {

	public static void main(String[] args) {
		Lucene logic = new Lucene();
		try {
			Long startTime = System.currentTimeMillis();
			
			List<Article> result = logic.getResult("卢");
			int i = 0;
			for (Article bean : result) {
				if (i == 10)
					break;
				System.out.println(" : bean.id " + bean.getId() + 
						" : bean.title "+ bean.getTitle()+
						":bean.content"+bean.getContent());
				i++;
			}
 
			System.out.println("searchBean.result.size : " + result.size());
			Long endTime = System.currentTimeMillis();
			System.out.println("查询所花费的时间为：" + (endTime - startTime) / 1000);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println(e.getMessage());
		}
	}
}
